<?php
 
	extract($_REQUEST);
	require_once("includes/constants.php");
	require_once("includes/database.php");

	if (updateFabric($selectedFabric, $f_name ,$f_type, $f_description, $f_color, $f_pattern, $f_image, $f_price_per_m, $f_stock, $f_fabric_width, $f_supplier_id) != 0) {
		$confirmationMessage = "$f_name records have been updated." ;
		getAllFabrics(); //update Fabric list in session 
		header( 'Location: confirmationPage.php?' . "confirmationMessage=" .$confirmationMessage) ;
		//require("confirmationPage.php");
	}
	else {
		$errorMessage = "There has been a problem updating details for $f_name.";
		header( 'Location: errorPage.php?' . "errorMessage=" . $errorMessage ) ;
		//require("errorPage.php");
		//checking svn difference
	}	
	;

?>
